home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crosscountry USA Photo Safari
/
Crosscountry USA Photo Safari.iso
/
Data
/
cc_base
/
pak00_16bit_f.pk3
/
common
/
switch_player.c4
< prev
Wrap
Text File
|
2002-09-09
|
3KB
|
93 lines
{
@switch_player {
resid CurPlayer;
resid OtherPlayer;
resid Player1ID;
resid Player2ID;
resid Game;
Game = ResByName("Game");
CurPlayer = ResPropGetResID(Game,"game_cur_player");
/* if this is only a one player game. we are done */
if (ResPropGetInt(Game,"game_num_players") == 1) {
stop;
}
/* pull out the player ids */
Player1ID = ResPropGetResID(Game,"player_1_id");
Player2ID = ResPropGetResID(Game,"player_2_id");
/* get other player */
if (CurPlayer != Player1ID) {
OtherPlayer = Player1ID;
} else {
OtherPlayer = Player2ID;
}
/* if the player we are switching to is done, we are done. */
/* but only if the dash is visible because otherwise it was the button that was pressed */
if(ResPropGetInt(ResByName("dash.gl"), "Hidden") == FALSE){
if (ResPropGetInt(OtherPlayer,"player_destination_arrived") == 1) {
stop;
}
}
/* do all the things we need to do to prep for next player */
AudioStop(ResPropGetInt(CurPlayer,"truck_wiper_sound_id"));
AudioStop(ResPropGetInt(CurPlayer,"truck_engine_sound_id"));
AudioStop(ResPropGetInt(CurPlayer,"truck_radio_sound_id"));
/* switch the players */
ResPropSetResID(Game,"game_cur_player",OtherPlayer);
/* i call these to keep sane */
/* set the temperature */
ResParseEvent(ResByName("common/set_temperature.c4"),"@set_temperature");
/* if its raining or snowing */
ResParseEvent(ResByName("common/set_rain_snow.c4"),"@set_rain_snow");
/* set night day */
ResParseEvent(ResByName("common/set_night_day.c4"),"@set_night_day");
/* set the segment controller to at city */
ResPropSetInt(ResByName("dash.gl/SegmentController"),"state",7);
/*--------TODO: COMMENT THIS SECTION----------*/
ResParseEvent(ResByName("map.gl/map"), "@update");
ResPropSetInt(ResByName("map.gl"),"Hidden",FALSE);
ResPropSetInt(ResByName("map.gl"),"Hidden",TRUE);
ResPropSetInt(ResByName("photo_album.gl"),"Hidden",FALSE);
ResPropSetInt(ResByName("photo_album.gl"),"Hidden",TRUE);
ResPropSetInt(ResByName("travel_log.gl"),"Hidden",FALSE);
ResPropSetInt(ResByName("travel_log.gl"),"Hidden",TRUE);
ResPropSetInt(ResByName("dispatch.gl"),"Hidden",TRUE);
ResPropSetInt(ResByName("dispatch.gl"),"Hidden",FALSE);
ResPropSetResID(ResByName("laptop.gl/dispatch"), "RadioGroupSelectedID", ResByName("laptop.gl/dispatch"));
ResParseEvent(ResByName("laptop.gl/dispatch"),"@activate");
if (ResPropGetInt(ResByName("dash.gl"), "Hidden") == FALSE) {
ResParseEvent(ResByName("common/hide_show.c4"),"@SHOW_TABS");
ResParseEvent(ResByName("dash.gl/GPS"),"@activate");
}
/*------------------*/
/* reset the time since last player switch */
ResPropSetInt(Game,"game_time_last_player_switch",
ResPropGetInt(
ResPropGetResID(Game,"game_cur_player"),
"time_now"
)
);
/* show the fullscreen player switch screen */
ResPropSetInt(ResByName("switch_player.gl"),"Hidden",FALSE);
}
}